﻿@using Orchard.ContentManagement;
@using Alexan.PhotoAlbums.Models;

@{
    Style.Require("jQueryLightbox");
    Script.Require("jQuery");
    Script.Require("jQueryLightbox");
    Script.Require("jQueryLazyload");     
}

@using (Script.Foot())
{
    <script type="text/javascript">
        $(function () {            
            var $li = $('article.content-item li');
            var curPos = 0;
            var line = 0;
            $li.each(function(){
                $item = $(this);
                pos = $item.offset().top;
                if(pos > (curPos + 10)){
                    line++;
                    //new line
                    $item.css('border-left-width', $item.css('border-right-width')); 
                }
                if(line == 1){ //top
                    $item.css('border-top-width', $item.css('border-bottom-width'));       
                }
                curPos = pos;
            });  
            
            $('#jquery-overlay').appendTo('body').hide();
            $('#jquery-lightbox').appendTo('body').hide();
            $('.content-item.photo a.thumb').lightBox({
                txtImage: '@T("Image")',
                txtOf: '@T("of")',
                delayAnimation: @Model.AnimationSpeed
            });

            $('a.thumb img').lazyload({effect : "fadeIn"});
        });
    </script>
}